package com.wj.abstractfactory;

import com.wj.abstractfactory.abstractfactory.HumanFactory;
import com.wj.abstractfactory.abstractfactory.impl.FuFactory;
import com.wj.abstractfactory.abstractfactory.impl.ManFactory;

/**抽象工厂模式
 * @author WangJin
 * @version 1.0
 * @date 2022/2/17 18:14
 */
public class NvWa {
    public static void main(String[] args) {
        //第一条生产线，男性生产线
        HumanFactory maleHumanFactory = new ManFactory();

        //第二条生产线，女性生产线
        HumanFactory femaleHumanFactory = new FuFactory();


        HuMan whiteHuman = maleHumanFactory.createWhiteHuman();
        HuMan yellowHuman = maleHumanFactory.createYellowHuman();
        HuMan fuYellowHuman = femaleHumanFactory.createYellowHuman();
        HuMan fuWhiteHuman = femaleHumanFactory.createWhiteHuman();


        whiteHuman.cry();
        whiteHuman.sex();
        fuWhiteHuman.laugh();
        fuWhiteHuman.sex();

        yellowHuman.talk();
        yellowHuman.sex();
        fuYellowHuman.laugh();
        fuYellowHuman.sex();
    }
}
